package com.cqcomponents.components;

import java.util.List;

import com.cqcomponents.annotations.ComponentInjection;
import com.cqcomponents.annotations.JcrPropertyInjection;

public class Grid extends BaseComponent {

	private List<Column> columns;
	private boolean fullWidth;

	@ComponentInjection(childName = "column_")
	public void setColumns(List<Column> columns) {
		this.columns = columns;
	}

	@JcrPropertyInjection
	public void setFullWidth(boolean fullWidth) {
		this.fullWidth = fullWidth;
	}

	public boolean isFullWidth() {
		return this.fullWidth;
	}

	public List<Column> getColumns() {
		return this.columns;
	}

	@Override
	public String toString() {
		return "Grid " + (this.columns != null ? this.columns.toString() : "");
	}

	@Override
	public boolean getHasContent() {
		return this.columns != null && this.columns.size() > 0;
	}

}
